package info.techgeek.labs.calendar;

import java.util.Calendar;
import java.util.Date;

public class SettingDates {

	public static void main(String[] args) {
		getDate(); 
	}
	public static Date getDate()
	{

		System.out.println("Start getDate ");

		Date date = null;

		Calendar gc = Calendar.getInstance();
		gc.clear();

		gc.setTime(new Date());
		System.out.println("Before time " + gc.getTime());

		System.out.println("MINUTE " + gc.get(Calendar.MINUTE));
		System.out.println("HOUR " + gc.get(Calendar.HOUR));
		System.out.println("DAY_OF_WEEK " + gc.get(Calendar.DAY_OF_WEEK));
		System.out.println("DAY_OF_MONTH " + gc.get(Calendar.DAY_OF_MONTH));
		System.out.println("MONTH " + gc.get(Calendar.MONTH));
		System.out.println("YEAR " + gc.get(Calendar.YEAR));
		
		gc.clear();
		
//		gc.set(Calendar.MINUTE, Integer.parseInt("30"));
//		gc.set(Calendar.HOUR, Integer.parseInt("12"));
//		gc.set(Calendar.DAY_OF_WEEK, Integer.parseInt("6"));
		gc.set(Calendar.DAY_OF_MONTH, Integer.parseInt("28"));
		gc.set(Calendar.MONTH, Integer.parseInt("10"));
		gc.set(Calendar.YEAR, Integer.parseInt("2009"));

		System.out.println("MINUTE " + gc.get(Calendar.MINUTE));
		System.out.println("HOUR " + gc.get(Calendar.HOUR));
		System.out.println("DAY_OF_WEEK " + gc.get(Calendar.DAY_OF_WEEK));
		System.out.println("DAY_OF_MONTH " + gc.get(Calendar.DAY_OF_MONTH));
		System.out.println("MONTH " + gc.get(Calendar.MONTH));
		System.out.println("YEAR " + gc.get(Calendar.YEAR));
		
		date = gc.getTime();

		System.out.println("End getDate Date " + date);

		return date;
	}
	
}
